package 第二章实用类作业;

import java.util.Scanner;

public class Goods {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String[] goods = {"电风扇", "洗衣机", "电视剧", "冰箱", "空调机"};
        Double[] prices = {124.23, 4500.0, 8800.9, 5000.88, 4456.0};
        System.out.println("***********欢迎进入商品批发城*********");
        System.out.println("编号     商品      价格");
        for (int i = 0; i <5 ; i++) {
            System.out.println(i+1+ "\t\t"+  goods[i]+ "\t\t"+  prices[i]);
        }
        System.out.println("请选择您要购买的商品编号");
        int num=input.nextInt();
        System.out.println("请输入您批发的数量");
        int number=input.nextInt();
        double money=prices[num-1]*number;

        String moneys=(int)money+"";
        StringBuffer s=new StringBuffer(moneys);
        for(int i=s.length()-3;i>0;i=i-3){
            s.insert(i,',');
        }
        System.out.println(s);
    }
}